top_builddir = ../..

include ../../config.mk

.SUFFIXES: .lo

CPPFLAGS = $(WERROR) $(BASECPPFLAGS) $(EXPORTSCPPFLAGS) $(SQLRENTERPRISECFLAGS) $(SQLRSERVERCFLAGS) $(RUDIMENTSCFLAGS) $(FWPKCFLAGS)
LIBS = $(SQLRENTERPRISELIBS) $(SQLRSERVERLIBS) $(RUDIMENTSLIBS)

.cpp.lo:
	$(LTCOMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE) $< $(OUT)$@

.cpp.obj:
	$(LTCOMPILE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(COMPILE) $<

all: $(SQLR)auth_mysql_userlist.$(LIBEXT) \
	$(SQLR)auth_mysql_database.$(LIBEXT) \

clean:
	$(LTCLEAN) $(RM) *.lo *.o *.obj *.$(LIBEXT) *.lib *.exp *.idb *.pdb *.manifest
	$(RMTREE) .libs

$(SQLR)auth_mysql_userlist.$(LIBEXT): mysql_userlist.cpp mysql_userlist.$(OBJ)
	$(LTLINK) $(LINK) $(OUT)$@ mysql_userlist.$(OBJ) $(LDFLAGS) $(LIBS) $(MODLINKFLAGS)

$(SQLR)auth_mysql_database.$(LIBEXT): mysql_database.cpp mysql_database.$(OBJ)
	$(LTLINK) $(LINK) $(OUT)$@ mysql_database.$(OBJ) $(LDFLAGS) $(LIBS) $(MODLINKFLAGS)

install: $(INSTALLLIB)

installdll:
	$(MKINSTALLDIRS) $(libexecdir)
	$(LTINSTALL) $(CP) $(SQLR)auth_mysql_userlist.$(LIBEXT) $(libexecdir)
	$(LTINSTALL) $(CP) $(SQLR)auth_mysql_database.$(LIBEXT) $(libexecdir)

installlib:
	$(MKINSTALLDIRS) $(libexecdir)
	$(LTINSTALL) $(CP) $(SQLR)auth_mysql_userlist.$(LIBEXT) $(libexecdir)
	$(RM) $(libexecdir)/$(SQLR)auth_mysql_userlist.a
	$(RM) $(libexecdir)/$(SQLR)auth_mysql_userlist.$(LIBEXT)
	$(MODULERENAME) $(libexecdir)/$(SQLR)auth_mysql_userlist.so so $(MODULESUFFIX)
	$(LTINSTALL) $(CP) $(SQLR)auth_mysql_database.$(LIBEXT) $(libexecdir)
	$(RM) $(libexecdir)/$(SQLR)auth_mysql_database.a
	$(RM) $(libexecdir)/$(SQLR)auth_mysql_database.$(LIBEXT)
	$(MODULERENAME) $(libexecdir)/$(SQLR)auth_mysql_database.so so $(MODULESUFFIX)

uninstall:
	$(RM) $(libexecdir)/$(SQLR)auth_mysql_userlist.* \
		$(libexecdir)/$(SQLR)auth_mysql_database.* \
		$(libexecdir)/sqlrauth_mysql_userlist.* \
		$(libexecdir)/sqlrauth_mysql_database.* \
		$(libexecdir)/$(SQLR)auth_test.* \
		$(libexecdir)/sqlrauth_test.*
